(

    $(function () {

    })
);

const hhh = () => {
    alert("哈哈哈哈哈哈哈哈哈");
}



let aaa = "dsadsadasdad";


//清空
function on_clear() {
    $("#ddl_ProcessName").val("");
    $("#txt_Summary").val("");
    $("#txt_StartDate").val("");
    $("#txt_EndDate").val("");
}

var a = "kkk";



let jsonData = {
    id: 42,
    status: "OK",
    data: [867, 5309]
  };
  
  let { id, status, data: number } = jsonData;
  
  console.log(id, status, number);
  // 42, "OK", [867, 5309]

let setval = () => { 
    $("#sel").append(
        ` <option  value=${$("#txt").val() +1213131} >测试</option> 
        <option  value=${$("#txt").val()} >测试</option>
        <option  value=${$("#txt").val()} >测试</option>
        <option  value=${$("#txt").val()} >测试</option>
        <option  value=${$("#txt").val()} >测试</option>
        <option  value=${$("#txt").val()} >测试</option> ` 
 )

    
    let c = "ceshi";
    var cccc = `aaaa${c+c}`;
    console.log(cccc);

    var url = "CRMReportExport.aspx?token=" + guid();
    console.log(url);
    url = `${url + guid()}
    1
    1
    3
    4`.replace(/ *[\r|\n] */gm, '');
    console.log(url);

}




function guid() {
    var d = new Date().getTime();
    var guid = 'xxxx-xxxx-xxxx-xxxx'.replace(
        /[xy]/g,
        function(c) {
            var r = (d + Math.random() * 16) % 16 | 0;
            d = Math.floor(d / 16);   
            return (c == 'x' ? r : (r & 0x7 | 0x8)).toString(16);
        });
    return guid;
};


var ceshi123 = (a, b,c) => { 
    console.log(a+b+c);
}



let str = 'return ' + '`Hello ${name}!`';
let func = new Function('name', str);
func('Jack') // "Hello Jack!"


function xxxxxy(x,y) {
    this.x = 1;
    this.y = 1;
    console.log(x,y)
}


const x = new xxxxxy(2,3);
x;




let xxx = 1488882;
var funx = xxxx => this.xxxx;
console.log(xxx);
var fooo = { xxxx: 9999999 };

console.log(funx.call(fooo));








   

let cc = Symbol("cc");
console.log(typeof cc)



function timeout(ms) {
    return new Promise((resolve, reject) => {
      setTimeout(resolve, ms, 'done');
    });
  }
  
  timeout(100).then((value) => {
    console.log(value);
});
  

let promise = new Promise(function(resolve, reject) {
    console.log('Promise');
    resolve();
  });
  
  promise.then(function() {
    throw new Error('test');
  }).catch(function(error) {
    // 处理 getJSON 和 前一个回调函数运行时发生的错误
    console.log('发生错误！', error);
  });

  



  var doAjaxCall = function (url, type, datatype, data, callBackFunction) {
    var returnFun = null;
    var indexLoading = null;
    var isLoading = null;

    type = typeof (type) != "undefined" ? type : 'post';
    datatype = typeof (datatype) != "undefined" ? datatype : 'json';
    data = (type.toLowerCase() == 'post') ? (typeof (data) == "string" ? data : JSON.stringify(data)) : data;
    callBackFunction = typeof (callBackFunction) != "undefined" ? callBackFunction : null;
    isLoading = callBackFunction == undefined || callBackFunction == null ? false : true;

    $.ajax({
        async: callBackFunction == undefined || callBackFunction == null ? false : true, //true为异步方式
        type: type,
        url: url,
        data: data,
        dataType: datatype,
        //contentType: 'application/json', //后加
        beforeSend: function (xhr) {
            //设置header

            xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8');
         
        },
        complete: function () {
           
        },
        success: function (data, textStatus) {
            callBackFunction(data);
          
        },
        error: function (jqXHR, textStatus, errorThrown) {
          
            alert("[SCRIPTS]Error:\r\n1: " + jqXHR + "\r\n2: " + textStatus + "\r\n3: " + errorThrown);
        }
    });
    return returnFun;
}
 

